#!/usr/bin/env python
# coding=UTF-8
'''
 * @Author       : z417
 * @Date         : 2020-03-09 21:33:31
 * @LastEditors: z417
 * @LastEditTime: 2020-03-10 00:46:54
 * @FilePath     : \\python/opreate_yml.py
 * @Description  : file desc
'''
import yaml
import os

data_path = os.path.join(os.path.dirname(__file__),
                         '..', 'data')

with open(data_path + "/customer.yml", 'r') as f:
    y = yaml.load(f)
    print(y)

temp = [{'autoclass': 'get study?'}]

with open(data_path + "/customer.yml", 'a+') as f:
    # 追加，继续在文档末尾添加
    yaml.dump(temp, f)
